﻿using SqlSugar;
using System.ComponentModel;
using System.Runtime.Serialization;

namespace ServiceCore.Entity.Model
{
    /// <summary>
    /// 系统用户表
    /// </summary>
    [DataContract(IsReference = true)]
    [SugarTable("s_user")]
    public class UserInfo
    {
        /// <summary>
        /// 主键
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] // 指定主键和自增
        [Description("id 主键自增长")]
        [DataMember]
        public System.Int64 Id { get; set; }

        /// <summary>
        /// 账号
        /// </summary>
        [DataMember]
        public System.String Account { get; set; }

        /// <summary>
        /// 用户姓名
        /// </summary>
        [DataMember]
        public System.String UserName { get; set; } = "";

        /// <summary>
        /// 密码
        /// </summary>
        [DataMember]
        public System.String Pwd { get; set; } = "";

        /// <summary>
        /// 是否管理员(1是0否)
        /// </summary>
        [DataMember]
        public System.Int32 IsAdmin { get; set; } = 0;

        // <summary>
        /// 是否启用(1是0否)
        /// </summary>
        [DataMember]
        public System.Int32? IsUsed { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [DataMember]
        public System.DateTime? CreateTime { get; set; } 

        /// <summary>
        /// 最后登录时间
        /// </summary>
        [DataMember]
        public System.DateTime? LastLoginTime { get; set; }

        [DataMember]
        [SugarColumn(IsIgnore = true)]
        public string Token { get; set; }
    }
}
